<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title><?php echo lang('chat.window.title.agent')?></title>
<?php echo css('home/chat/chat.css')?>
<?php echo js('chat/common.js')?>
<?php echo js('chat/brws.js')?>
<script type="text/javascript" language="javascript">
<!--
var threadParams = { servl:"<?php echo site_url('chat/get')?>",wroot:"<?php echo site_url()?>",frequency:<?php echo $frequency;?>,<?php if($user):?>user:"true",<?php endif;?>threadid:<?php echo $ct_chatThreadId?>,token:<?php echo $ct_token?>,cssfile:"<?php echo css_url('home/chat/chat.css')?>",ignorectrl:<?php echo $ignorectrl;?> };
//-->
</script>
<?php echo js('chat/chat.js')?>
<style type="text/css">
#header{
	height:50px;
	background:url(<?php echo image_url('home/chat/bg_domain.gif')?>) repeat-x top;
	background-color:#5AD66B;
	width:99.6%;
	margin:0px 0px 20px 0px;
}
#header .mmimg{
	background:url(<?php echo image_url('home/chat/quadrat.gif')?>) bottom left no-repeat;
}
.but{
	font-family:Verdana !important;
	font-size:11px;
	background:url(<?php echo image_url('home/chat/wmchat.png')?>) top left no-repeat;
	background-position:0px -25px;
	display:block;
	text-align:center;
	padding-top:2px;
	color:white;
	width:186px;
	height:18px;
	text-decoration:none;
}
.tplimage {
	background: transparent url(<?php echo image_url('home/chat/wmchat.png')?>) no-repeat scroll 0px 0px;
	width: 25px; height: 25px;
	-moz-background-clip: -moz-initial; 
	-moz-background-origin: -moz-initial; 
	-moz-background-inline-policy: -moz-initial;
}
.irefresh { background-position:-72px 0px; }
.iclose { background-position:-24px 0px; }
.iexec { background-position:-48px 0px; }
.ihistory, .ichangeuser { background-position:-96px 0px; }
.isend { background-position:-120px 0px; }
.issl { background-position:-144px 0px; }
.isound { background-position:-168px 0px; }
.inosound { background-position:-192px 0px; }
.iemail { background-position:0px 0px; }
.iclosewin { background-position:-187px -27px; width: 15px; height: 15px; }
.tplimageloc {
	background: transparent url(<?php echo image_url('home/chat/wmchat2.png')?>) no-repeat scroll 0px 0px;
	-moz-background-clip: -moz-initial; 
	-moz-background-origin: -moz-initial; 
	-moz-background-inline-policy: -moz-initial;
}
.ilog { background-position: 0px 0px;width: 20px; height: 80px; }
.imessage { background-position: 0px -82px;width: 20px; height: 85px; }
</style>

</head>
<body bgcolor="#FFFFFF" text="#000000" link="#C28400" vlink="#C28400" alink="#C28400" style="margin:0px;">

<table width="100%" style="height:100%;" cellspacing="0" cellpadding="0" border="0">
<tr>
<td valign="top">

	<table width="100%" style="height:100%;" cellspacing="0" cellpadding="0" border="0">
	<tr>
    <td></td>
    <td colspan="2" height="100" valign="top" class="bgrn">
		<table width="100%" cellspacing="0" cellpadding="0" border="0">
		<tr>
			<td width="100%">
	        	    	<a onclick="window.open('<?php echo $webimHost?>');return false;" href="<?php echo $webimHost?>">
	        	    		<img src="<?php echo image_url('home/chat/webimlogo.gif')?>" border="0" alt=""/>
	        	    	</a>
			</td>
			<td align="right" valign="top" id="banner_orange">
				<table cellspacing="0" cellpadding="0" border="0" width="460">
				<tr>
					<td height="30" align="right" valign="top" style="padding:5px">
						<div id="engineinfo" style="display:none;">
						</div>
						<div id="typingdiv" style="display:none;">
							<?php echo lang('typing.remote')?>
						</div>
					</td>
				</tr>
				<tr>
					<td height="40" align="right" nowrap style="padding-right:10px"><span style="font-size:16px;font-weight:bold;color:#525252"><?php echo $chat_title?></span></td>
				</tr>
				<tr>
					<td height="30"></td>
				</tr>
				</table>
			</td>
		</tr>
		</table>

		<table cellspacing="0" cellpadding="0" border="0" id="header" class="bg_domain">
		<tr>
			<td style="padding-left:20px" class="mmimg">
				<table cellspacing="0" cellpadding="0" border="0">
<?php if($agent):?>
				<td class="text" nowrap>
					<?php if($historyParams):?>
						<?php echo lang('chat.window.chatting_with')?>
						<a href="${page:historyParamsLink}" target="_blank" title="${msg:page.analysis.userhistory.title}" onclick="this.newWindow = window.open('${page:historyParamsLink}', 'UserHistory', 'toolbar=0,scrollbars=0,location=0,statusbar=1,menubar=0,width=703,height=380,resizable=1');this.newWindow.focus();this.newWindow.opener=window;return false;">${page:ct.user.name}</a>
					<?php else:?>
						<?php echo lang('chat.window.chatting_with')?> <b><?php echo $ct_user_name;?></b>
					<?php endif;?>
				</td>
<?php endif?>
<?php if($user):?>
				<td class="text" nowrap>
					<?php echo lang('chat.client.name')?>&nbsp;<?php echo $ct_user_name;?>
				</td>
<?php endif?>
<?php if($agent):?>
				<td width="10" valign="top"><img src='<?php echo image_url('home/chat/free.gif')?>' width="10" height="1" border="0" alt="" /></td>
				<td><a class="closethread" href="javascript:void(0)" onclick="return false;" title="<?php echo lang('chat.window.close_title');?>">
				<img class="tplimage iclose" src="<?php echo image_url('home/chat/free.gif')?>" border="0" alt="<?php echo lang('chat.window.close_title');?>"/></a></td>
<?php endif?>

				<td style="color:#C9C9C9;font-size:40px;padding:0px 15px 5px 15px">|</td>
				<td width="20" valign="top"><img src='<?php echo image_url('home/chat/free.gif')?>' width="20" height="1" border="0" alt="" /></td>
				</tr>
				</table>
			</td>
			<td align="right" style="padding-right:17px;">
				<table cellspacing="0" cellpadding="0" border="0">
				<tr>
				<td class="text"><span class="grey"></span></td>
				<td width="5"></td>
				<td>
					<table cellspacing="0" cellpadding="0" border="0">
					<tr>
					<td width="95" height="13" bgcolor="#D09221" align="center" class="www"><a href="<?php echo site_url()?>" target="_blank"><?php echo lang('site.title')?></a></td>
					</tr>
					</table>
				</td>
				<td width="5"></td>
				<td><a class="closethread" href="javascript:void(0)" onclick="return false;" title="<?php echo lang('chat.window.close_title')?>"><img class="tplimage iclosewin" src="<?php echo image_url('home/chat/free.gif')?>" border="0" alt="<?php echo lang('chat.window.close_title')?>"/></a></td>
				<td width="5"></td>
				</tr>
				</table>
			</td>
		</tr>
		</table>

	</td>
	</tr>

	<tr>
    <td></td>
    <td valign="top">

		<table width="100%" style="height:100%;" cellspacing="0" cellpadding="0" border="0">
		<tr>
	    <td width="20" valign="top"><img class="tplimageloc ilog" src="<?php echo image_url('home/chat/free.gif')?>" border="0" alt="" /></td>
    	<td colspan="2" width="100%" height="100%" valign="top" id="chatwndtd">
			<table width="100%" style="height:100%;" cellspacing="0" cellpadding="0" border="0">
			<tr>
		    <td colspan="3" bgcolor="#A1A1A1"><img src='<?php echo image_url('home/chat/free.gif')?>' width="1" height="1" border="0" alt="" /></td>
			</tr>
			<tr>
		    <td bgcolor="#A1A1A1"><img src='<?php echo image_url('home/chat/free.gif')?>' width="1" height="1" border="0" alt="" /></td>
		    <td width="100%" height="100%" bgcolor="#FFFFFF" valign="top">
				<iframe id="chatwnd" width="100%" height="100%" src="<?php if($neediframesrc):?><?php echo image_url('home/chat/blank.html')?><?php endif;?>" frameborder="0" style="overflow:auto;">
				Sorry, your browser does not support iframes; try a browser that supports W3 standards.
				</iframe>
			</td>
		    <td bgcolor="#A1A1A1"><img src='<?php echo image_url('home/chat/free.gif')?>' width="1" height="1" border="0" alt="" /></td>
			</tr>
			<tr>
		    <td colspan="3" bgcolor="#A1A1A1"><img src='<?php echo image_url('home/chat/free.gif')?>' width="1" height="1" border="0" alt="" /></td>
			</tr>
			</table>
		</td>
		</tr>
<?php if($canpost):?>
		<tr>
	    <td colspan="3" height="5" style="cursor:n-resize;" id="spl1"></td>
		</tr>

		<tr>
	    <td width="20" valign="top"><img class="tplimageloc imessage" src="<?php echo image_url('home/chat/free.gif')?>" border="0" alt="" /></td>
	    <?php if($isOpera95):?>
    	<td width="100%" height="60%" valign="top" id="msgwndtd">
    	<?php else:?>
	    	        	<td width="100%" height="100" valign="top" id="msgwndtd">
    	<?php endif;?>
    				<table width="100%" style="height:100%;" cellspacing="0" cellpadding="0" border="0"><tr><td colspan="3" bgcolor="#A1A1A1"><img src="<?php echo image_url('home/chat/free.gif')?>" width="1" height="1" border="0" alt="" /></td></tr><tr><td bgcolor="#A1A1A1"><img src="<?php echo image_url('home/chat/free.gif')?>" width="1" height="1" border="0" alt="" /></td><td width="100%" height="100%" bgcolor="#FFFFFF" valign="top">
				<textarea id="msgwnd" class="message" tabindex="0"></textarea>
			</td><td bgcolor="#A1A1A1"><img src="<?php echo image_url('home/chat/free.gif')?>" width="1" height="1" border="0" alt="" /></td></tr><tr><td colspan="3" bgcolor="#A1A1A1"><img src="<?php echo image_url('home/chat/free.gif')?>" width="1" height="1" border="0" alt="" /></td></tr></table>
		</td>
	    <td valign="middle" id="avatarwnd"></td>
		</tr>
<?php endif;?>
		</table>

	</td>
    <td></td>
	</tr>

	<tr>
    <td height="45"></td>
    <td>
		<table width="100%" cellspacing="0" cellpadding="0" border="0">
		<tr>
	    <td align="left">
			<table cellspacing="0" cellpadding="0" border="0">
			<tr>
		    <td width="20"></td>
<?php if($agent):?>
	<?php if($canpost):?>
		    <td>
				<select id="predefined" size="1" class="answer">
				<option><?php echo lang('chat.window.predefined.select_answer');?></option>
				<?php echo $predefinedAnswers?>
				</select>
			</td>
	<?php endif;?>
<?php endif;?>
			</tr>
			</table>
		</td>
		<td id="poweredByTD" align="center" class="copyr"><?php echo lang('chat.window.poweredby')?> <a id="poweredByLink" href="<?php echo site_url()?>" title="<?php echo lang('site.title')?>" target="_blank"><?php echo lang('site.title')?></a></td>
		<td align="right">

<?php if($canpost):?>
			<table cellspacing="0" cellpadding="0" border="0" id="postmessage">
			<tr>
			<td><a href="javascript:void(0)" onclick="return false;" class="but" id="sndmessagelnk"><?php echo sprintf(lang('chat.window.send_message_short'), '##')?></a></td>
			</tr>
			</table>
<?php endif;?>
		</td>
		</tr>
		</table>
	</td>
    <td></td>
	</tr>

	<tr>
    <td width="10"><img src='<?php echo image_url('home/chat/free.gif')?>' width="10" height="1" border="0" alt="" /></td>
    <td width="100%"><img src='<?php echo image_url('home/chat/free.gif')?>' width="585" height="1" border="0" alt="" /></td>
    <td width="5"><img src='<?php echo image_url('home/chat/free.gif')?>' width="5" height="1" border="0" alt="" /></td>
	</tr>
	</table>

</td>
</tr>
</table>

</body>
</html>
